<template>
	<view class="navigation" :style="{backgroundColor:color}">
		<view :style="{height:iStatusBarHeight + 'px;width:100%'}"></view>

		<!-- #ifdef H5 -->
		<view @click="back" class="back"><span class="iconfont icon-fanhui"></span></view>
		<!-- #endif -->
		<view class="title" v-if="show">
			<view>{{title}}</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		props: {
			delta: Number,
			title: String
		},
		data() {
			return {
				iStatusBarHeight: 0,
				styles: {},
				show: false,
				color:"",
			};
		},
		mounted() {
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: this.delta,
				});
			},
		},
		beforeDestroy() {
		  //销毁滚动底部加载事件
		  uni.$off("onPageScroll");
		},
		watch: {},
	};
</script>

<style lang="scss" scoped>
	.bg {
		background-color: rgba(105, 99, 99, 0.3)
	}

	.navigation {
		position: fixed;
		display: flex;
		align-items: center;
		z-index: 99;
		height: 110rpx;
		flex-wrap: wrap;
		width: 10%;
		top: 0;
        // background-color: red;
		.back {
			// width: 20%;
			position: relative;
			z-index: 9;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-left: 10rpx;
			color: #000;

			span {
				font-size: 50rpx;
			}
		}

		.title {
			color: #fff;
			display: flex;
			position: absolute;
			justify-content: center;
			align-items: center;
			font-size: 32rpx;
			width: 100%;

			.title>view {
				width: 60%;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
		}
	}
</style>
